import { onMounted } from "vue";
import hljs from "highlight.js"; // 引入 highlight.js

export function useHighLight() {
  const handleHighLight = () => {
    let blocks = document.querySelectorAll("pre code");
    blocks.forEach((block) => {
      hljs.highlightBlock(block);
    });
  };

  onMounted(() => {
    handleHighLight();
  });
}
